const express=require('express');
const router=express.Router();
const userinfo_handler=require('../router_handler/userinfo');

const expressJoi=require('@escook/express-joi');
// const expressJoi=require('joi');
const {update_userinfo_schema,update_pwd_schema, update_avatar}=require('../schema/user')
//获取用户基本信息的路由处理函数
router.get('/userinfo',userinfo_handler.getInfo)
//更新用户信息的路由处理函数
router.post('/userinfo',expressJoi(update_userinfo_schema),userinfo_handler.updateUserInfo)
router.post('/updatepwd',expressJoi(update_pwd_schema),userinfo_handler.updatePwd);
router.post('/update/avatar',expressJoi(update_avatar),userinfo_handler.updateAvatar)
module.exports=router;